<?php 
class Front_PrintPayment_Generic extends System_Db_Generic  {
	public function getPaymentDetail($paymentId){
		$db = Zend_Registry :: get("db");
		$cmd_exec = "exec dbo.sp_Payment_Get_translist '".$paymentId."', NULL, NULL, NULL, NULL";
		$statement = $db->prepare($cmd_exec);
		$statement->execute();
		$results = $statement->fetchAll();
		return $results['0'];
	}
	
	public function getPreAuthById($preauth_id,$user_id){
		$db = Zend_Registry :: get("db");
		$cmd_exec = "exec dbo.sp_Preauth_Get_translist '".$preauth_id."',NULL,NULL,'".$user_id."',NULL";
		$statement = $db->prepare($cmd_exec);
		$statement->execute();
		$results = $statement->fetchAll();
		foreach ($results as $key=>$value){
			$results[$key]['preauth_datetime'] = getDateFormat2($results[$key]['preauth_datetime']);
		}
	}
		public function getPolicyById($policy_id){
			if(!$policy_id) return;
			$db = Zend_Registry :: get("db");
			$cmd_exec = "exec dbo.sp_queryByPolicyId '$policy_id'";
			//echo $cmd_exec; exit();
			$statement = $db->prepare($cmd_exec);
			$statement->execute();
			$results = $statement->fetchAll();
			foreach ($results as $key=>$value){
				$results[$key]['effective'] = getDateFormat2($results[$key]['effective']);
				$results[$key]['expiry'] = getDateFormat2($results[$key]['expiry']);
				$results[$key]['me_cover'] = number_format($results[$key]['me_cover'],2,'.',',');
				$results[$key]['mc_cover'] = number_format($results[$key]['mc_cover'],2,'.',',');
			}
			return $results['0'];
		}
		
		public function getClaimCover(){
			$db = Zend_Registry :: get("db");
			$cmd_exec = "exec dbo.sp_Claim_Get_Cover_Type NULL";
			//echo $cmd_exec; exit();
			$statement = $db->prepare($cmd_exec);
			$statement->execute();
			$results = $statement->fetchAll();
			return $results;
		}
}
?>